<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require(__DIR__ . '/../../../vendor/autoload.php');
require(__DIR__ . '/../../../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../../../common/config/bootstrap.php');
require(__DIR__ . '/../../../backend/config/bootstrap.php');
$configFiles = [
    '/../../../common/config/main.php',
    '/../../../common/config/main-local.php',
    '/../../../backend/config/main.php',
    '/../../../backend/config/main-local.php'
];

$conf = [];
foreach($configFiles as $file) {
    if(file_exists(__DIR__.$file)){
        $tmp = require __DIR__.$file;
        $conf = yii\helpers\ArrayHelper::merge($conf, $tmp);
    }
}

$application = new yii\web\Application($conf);
$application->language = 'zh-CN';
$application->run();
